import 'package:flutter_agent_terminal/generated/json/base/json_convert_content.dart';
import 'package:flutter_agent_terminal/bean/selection_data_bean_entity.dart';

SelectionDataBeanEntity $SelectionDataBeanEntityFromJson(Map<String, dynamic> json) {
	final SelectionDataBeanEntity selectionDataBeanEntity = SelectionDataBeanEntity();
	final int? errno = jsonConvert.convert<int>(json['errno']);
	if (errno != null) {
		selectionDataBeanEntity.errno = errno;
	}
	final SelectionDataBeanData? data = jsonConvert.convert<SelectionDataBeanData>(json['data']);
	if (data != null) {
		selectionDataBeanEntity.data = data;
	}
	return selectionDataBeanEntity;
}

Map<String, dynamic> $SelectionDataBeanEntityToJson(SelectionDataBeanEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['errno'] = entity.errno;
	data['data'] = entity.data.toJson();
	return data;
}

SelectionDataBeanData $SelectionDataBeanDataFromJson(Map<String, dynamic> json) {
	final SelectionDataBeanData selectionDataBeanData = SelectionDataBeanData();
	final List<SelectionDataBeanDataList>? list = jsonConvert.convertListNotNull<SelectionDataBeanDataList>(json['list']);
	if (list != null) {
		selectionDataBeanData.list = list;
	}
	return selectionDataBeanData;
}

Map<String, dynamic> $SelectionDataBeanDataToJson(SelectionDataBeanData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['list'] =  entity.list.map((v) => v.toJson()).toList();
	return data;
}

SelectionDataBeanDataList $SelectionDataBeanDataListFromJson(Map<String, dynamic> json) {
	final SelectionDataBeanDataList selectionDataBeanDataList = SelectionDataBeanDataList();
	final String? title = jsonConvert.convert<String>(json['title']);
	if (title != null) {
		selectionDataBeanDataList.title = title;
	}
	final String? key = jsonConvert.convert<String>(json['key']);
	if (key != null) {
		selectionDataBeanDataList.key = key;
	}
	final String? type = jsonConvert.convert<String>(json['type']);
	if (type != null) {
		selectionDataBeanDataList.type = type;
	}
	final String? defaultValue = jsonConvert.convert<String>(json['defaultValue']);
	if (defaultValue != null) {
		selectionDataBeanDataList.defaultValue = defaultValue;
	}
	final String? value = jsonConvert.convert<String>(json['value']);
	if (value != null) {
		selectionDataBeanDataList.value = value;
	}
	final List<SelectionDataBeanDataListChildren>? children = jsonConvert.convertListNotNull<SelectionDataBeanDataListChildren>(json['children']);
	if (children != null) {
		selectionDataBeanDataList.children = children;
	}
	return selectionDataBeanDataList;
}

Map<String, dynamic> $SelectionDataBeanDataListToJson(SelectionDataBeanDataList entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['title'] = entity.title;
	data['key'] = entity.key;
	data['type'] = entity.type;
	data['defaultValue'] = entity.defaultValue;
	data['value'] = entity.value;
	data['children'] =  entity.children.map((v) => v.toJson()).toList();
	return data;
}

SelectionDataBeanDataListChildren $SelectionDataBeanDataListChildrenFromJson(Map<String, dynamic> json) {
	final SelectionDataBeanDataListChildren selectionDataBeanDataListChildren = SelectionDataBeanDataListChildren();
	final String? title = jsonConvert.convert<String>(json['title']);
	if (title != null) {
		selectionDataBeanDataListChildren.title = title;
	}
	final String? key = jsonConvert.convert<String>(json['key']);
	if (key != null) {
		selectionDataBeanDataListChildren.key = key;
	}
	final String? type = jsonConvert.convert<String>(json['type']);
	if (type != null) {
		selectionDataBeanDataListChildren.type = type;
	}
	final String? defaultValue = jsonConvert.convert<String>(json['defaultValue']);
	if (defaultValue != null) {
		selectionDataBeanDataListChildren.defaultValue = defaultValue;
	}
	final String? value = jsonConvert.convert<String>(json['value']);
	if (value != null) {
		selectionDataBeanDataListChildren.value = value;
	}
	return selectionDataBeanDataListChildren;
}

Map<String, dynamic> $SelectionDataBeanDataListChildrenToJson(SelectionDataBeanDataListChildren entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['title'] = entity.title;
	data['key'] = entity.key;
	data['type'] = entity.type;
	data['defaultValue'] = entity.defaultValue;
	data['value'] = entity.value;
	return data;
}